﻿<%@ Page Language="C#"  MasterPageFile="~/templates/template.Master" AutoEventWireup="true" CodeBehind="empleado.aspx.cs" Inherits="GesWork.maestros.empleado" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxcontroltoolkit" %>


    <asp:content ID="df" runat="server" ContentPlaceHolderID="ContentPlaceHolder1">
      
    <ajaxcontroltoolkit:TabContainer ID="tabcont" runat="server"   Width="690px"
    ActiveTabIndex="0">
         <ajaxcontroltoolkit:TabPanel runat="server" ID="tabUser"  HeaderText="Datos"><ContentTemplate>
         
               <asp:FormView ID="FormView1" runat="server" CellPadding="4" DataKeyNames="ID" DataSourceID="dsEmpleados" 
                    ForeColor="#333333"  
                    Width="670px" AllowPaging="True"  >
                    <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                    <RowStyle BackColor="#b3b3b3"  /><EditRowStyle  BackColor="#b3b3b3"  ForeColor="White" />
                    <EditItemTemplate>
                      <div class="recuadro">
                        ID:
                        <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                       
                       <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                       
                        Saludo:
                         <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="dsSaludation"  Text='<%# Bind("Saludation") %>' 
                            DataTextField="saludo" DataValueField="id">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="dsSaludation" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
                            SelectCommand="SELECT [saludo], [id] FROM [Saludation]"></asp:SqlDataSource>
                        <br />
                        Nombre:
                        <asp:TextBox ID="NameTextBox" runat="server" 
                            Text='<%# Bind("Name") %>' />
                        <br />
                        Primer Apellido:
                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                            Text='<%# Bind("FirstName") %>' />
                        <br />
                        Segundo Apellido:
                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                            Text='<%# Bind("LastName") %>' />
                        <br />
                         DNI:
                        <asp:TextBox ID="DNITextBox" runat="server" 
                            Text='<%# Bind("DNI") %>' />
                        
                        <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                         
                        Cargo:
                        <asp:TextBox ID="PostTextBox" runat="server" 
                            Text='<%# Bind("Post") %>' />
                       
                        
                        <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                         
                        Edad de Nacimiento:
                        <asp:TextBox ID="BirthDayTextBox" runat="server" 
                            Text='<%# Bind("BirthDay") %>' />
                             <ajaxcontroltoolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="BirthDayTextBox" FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
                            </ajaxcontroltoolkit:CalendarExtender>
                        <br />
                        Telefono 1:
                        <asp:TextBox ID="CI_Telephone1TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone1") %>' />
                        <br />
                        Telefono 2:
                        <asp:TextBox ID="CI_Telephone2TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone2") %>' />
                        <br />
                        Telefono 3:
                        <asp:TextBox ID="CI_Telephone3TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone3") %>' />
                        <br />
                        FAX:
                        <asp:TextBox ID="CI_FaxTextBox" runat="server" 
                            Text='<%# Bind("CI_Fax") %>' />
                        <br />
                        Email 1:
                        <asp:TextBox ID="CI_Email1TextBox" runat="server" 
                            Text='<%# Bind("CI_Email1") %>' />
                        <br />
                        Email 2:
                        <asp:TextBox ID="CI_Email2TextBox" runat="server" 
                            Text='<%# Bind("CI_Email2") %>' />
                        <br />
                        Email 3:
                        <asp:TextBox ID="CI_Email3TextBox" runat="server" 
                            Text='<%# Bind("CI_Email3") %>' />
                        <br />
                        Web:
                        <asp:TextBox ID="CI_WebTextBox" runat="server" 
                            Text='<%# Bind("CI_Web") %>' />
                        <br />
                        
                        Direccion:
                        <asp:TextBox ID="DireccionTextBox" runat="server" 
                            Text='<%# Bind("Direccion") %>' />
                        <br />
                        Poblacion:
                        <asp:TextBox ID="PoblacionTextBox" runat="server" 
                            Text='<%# Bind("Poblacion") %>' />
                        <br />
                        CP:
                        <asp:TextBox ID="CPTextBox" runat="server" Text='<%# Bind("CP") %>' />
                        <br />
                        Provincia:
                        <asp:TextBox ID="ProvinciaTextBox" runat="server" 
                            Text='<%# Bind("Provincia") %>' />
                        <br />
                        Pais:
                        <asp:TextBox ID="PaisTextBox" runat="server" Text='<%# Bind("Pais") %>' />
                    
                    
                    <br /><br /> 
                         <div class="separador"></div> 
                         <br />    
                        
                        Quote:
                        <asp:TextBox ID="QuoteTextBox" runat="server" 
                            Text='<%# Bind("Quote") %>' />
                        <br />
                        Imagen:
                        <asp:TextBox ID="IMG_ImageTextBox" runat="server" 
                            Text='<%# Bind("IMG_Image") %>' />
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />    
                         
                        
        <asp:ImageButton ID="UpdateButton" runat="server"  ImageUrl="~/images/btnGuardar.png"  CssClass="botones" CausesValidation="True" 
                            CommandName="Update" Text="Actualizar" />
                       
        <asp:ImageButton ID="UpdateCancelButton" runat="server"  ImageUrl="~/images/btnCancelar.png"  CssClass="botones" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                            
                       </div>
                    </EditItemTemplate>
                    <InsertItemTemplate>
                      <div class="recuadro"> 
                        Saludo:
                      
                        <asp:DropDownList ID="DropDownList2" runat="server" DataSourceID="dsSaludation"  Text='<%# Bind("Saludation") %>' 
                            DataTextField="saludo" DataValueField="id">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="dsSaludation" runat="server" 
                            ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
                            SelectCommand="SELECT [saludo], [id] FROM [Saludation]"></asp:SqlDataSource>
                        <br />
                        Nombre :
                        <asp:TextBox ID="NameTextBox" runat="server" 
                            Text='<%# Bind("Name") %>' />
                        <br />
                        Primer Apellido:
                        <asp:TextBox ID="FirstNameTextBox" runat="server" 
                            Text='<%# Bind("FirstName") %>' />
                        <br />
                        Segundo Apellido:
                        <asp:TextBox ID="LastNameTextBox" runat="server" 
                            Text='<%# Bind("LastName") %>' />
                        <br />
                        DNI:
                        <asp:TextBox ID="DNITextBox" runat="server" Text='<%# Bind("DNI") %>' />
                        
                        <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        Cargo:
                        <asp:TextBox ID="PostTextBox" runat="server" 
                            Text='<%# Bind("Post") %>' />
                        
                        <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        Fecha de nacimiento:
                        <asp:TextBox ID="BirthDayTextBox" runat="server" 
                            Text='<%# Bind("BirthDay") %>' />
                            <ajaxcontroltoolkit:CalendarExtender ID="CalendarExtender1" runat="server" TargetControlID="BirthDayTextBox" FirstDayOfWeek="Monday" Format="dd/MM/yyyy">
                            </ajaxcontroltoolkit:CalendarExtender>
                        <br />
                        Telefono 1:
                        <asp:TextBox ID="CI_Telephone1TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone1") %>' />
                        <br />
                        Telefono 2:
                        <asp:TextBox ID="CI_Telephone2TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone2") %>' />
                        <br />
                        Telefono 3:
                        <asp:TextBox ID="CI_Telephone3TextBox" runat="server" 
                            Text='<%# Bind("CI_Telephone3") %>' />
                        <br />
                        Fax:
                        <asp:TextBox ID="CI_FaxTextBox" runat="server" 
                            Text='<%# Bind("CI_Fax") %>' />
                        <br />
                        Email 1:
                        <asp:TextBox ID="CI_Email1TextBox" runat="server" 
                            Text='<%# Bind("CI_Email1") %>' />
                        <br />
                        Email 2:
                        <asp:TextBox ID="CI_Email2TextBox" runat="server" 
                            Text='<%# Bind("CI_Email2") %>' />
                        <br />
                        Email 3:
                        <asp:TextBox ID="CI_Email3TextBox" runat="server" 
                            Text='<%# Bind("CI_Email3") %>' />
                        <br />
                        Web:
                        <asp:TextBox ID="CI_WebTextBox" runat="server" 
                            Text='<%# Bind("CI_Web") %>' />
                        <br />
                        
                        Direccion:
                        <asp:TextBox ID="DireccionTextBox" runat="server" 
                            Text='<%# Bind("Direccion") %>' />
                        <br />
                        Poblacion:
                        <asp:TextBox ID="PoblacionTextBox" runat="server" 
                            Text='<%# Bind("Poblacion") %>' />
                        <br />
                        CP:
                        <asp:TextBox ID="CPTextBox" runat="server" Text='<%# Bind("CP") %>' />
                        <br />
                        Provincia:
                        <asp:TextBox ID="ProvinciaTextBox" runat="server" 
                            Text='<%# Bind("Provincia") %>' />
                        <br />
                        Pais:
                        <asp:TextBox ID="PaisTextBox" runat="server" Text='<%# Bind("Pais") %>' />
                       
                        
                        <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                         
                        Comision:
                        <asp:TextBox ID="QuoteTextBox" runat="server" 
                            Text='<%# Bind("Quote") %>' />
                        <br />
                        Imagen:
                        <asp:TextBox ID="IMG_ImageTextBox" runat="server" 
                            Text='<%# Bind("IMG_Image") %>' />
                        
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />    
                         
                        
        <asp:ImageButton ID="InsertButton" runat="server"  ImageUrl="~/images/btnGuardar.png"  CssClass="botones" CausesValidation="True" 
                            CommandName="Insert" Text="Insertar" />
                       
        <asp:ImageButton ID="InsertCancelButton" runat="server"  ImageUrl="~/images/btnCancelar.png"  CssClass="botones" 
                            CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                      </div>
                    </InsertItemTemplate>
                    <ItemTemplate>
                     
                         <div class="separador"></div> 
                          <!--<br />
                        
                        <b>ID:</b> -->
                        <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' Visible="false"/>
                        
                       
                         <br />
                        
                        <b>Nombre: </b> <asp:Label ID="SaludationLabel" runat="server" 
                            Text='<%# Bind("Saludation") %>' /> 
                            <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />  
                            <asp:Label ID="FirstNameLabel" runat="server" Text='<%# Bind("FirstName") %>' /> 
                            <asp:Label ID="LastNameLabel" runat="server"  Text='<%# Bind("LastName") %>' />
                        <br />
                        
                        <b>DNI:</b> <asp:Label ID="DNILabel" runat="server" Text='<%# Bind("DNI") %>' />
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        <b>Puesto:</b>
                        <asp:Label ID="PostLabel" runat="server" Text='<%# Bind("Post") %>' />
                        
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        <b>Edad de Nacimiento:</b>
                        <asp:Label ID="BirthDayLabel" runat="server" 
                            Text='<%# Bind("BirthDay", "{0:dd/yyyy}") %>' />
                        <br />
                        
                        <b>Direccion:</b>
                        <asp:Label ID="DireccionLabel" runat="server" Text='<%# Bind("Direccion") %>' />
                        <br />
                        <b>Poblacion:</b>
                        <asp:Label ID="PoblacionLabel" runat="server" Text='<%# Bind("Poblacion") %>' />
                        <br />
                        <b>CP:</b>
                        <asp:Label ID="CPLabel" runat="server" Text='<%# Bind("CP") %>' />
                        <br />
                        <b>Provincia:</b>
                        <asp:Label ID="ProvinciaLabel" runat="server" Text='<%# Bind("Provincia") %>' />
                        <br />
                        <b>Pais:</b>
                        <asp:Label ID="PaisLabel" runat="server" Text='<%# Bind("Pais") %>' />
                        <br />
                        
                         <b>Telefonos :</b>
                            <asp:Label ID="CI_Telephone1Label" runat="server"  Text='<%# Bind("CI_Telephone1") %>' /> &nbsp;&nbsp;&nbsp;
                            <asp:Label ID="CI_Telephone2Label" runat="server"  Text='<%# Bind("CI_Telephone2") %>' /> &nbsp;&nbsp;&nbsp;
                            <asp:Label ID="CI_Telephone3Label" runat="server"  Text='<%# Bind("CI_Telephone3") %>' />
                        <br />
                        
                        <b>Fax:</b>
                        <asp:Label ID="CI_FaxLabel" runat="server" Text='<%# Bind("CI_Fax") %>' />
                        <br />
                        <b>Correos:</b>
                        <a href="<%# Eval("CI_Email1") %>"><asp:Label ID="CI_Email1Label" runat="server" Text='<%# Bind("CI_Email1") %>' /></a>&nbsp;&nbsp;&nbsp;
                        <a href="<%# Eval("CI_Email2") %>"><asp:Label ID="CI_Email2Label" runat="server" Text='<%# Bind("CI_Email2") %>' /></a>&nbsp;&nbsp;&nbsp;
                        <a href="<%# Eval("CI_Email3") %>"><asp:Label ID="CI_Email3Label" runat="server" Text='<%# Bind("CI_Email3") %>' /></a>
                        <br />
                        
                        <b>Web:</b>
                        <a href="<%# Eval("CI_Web") %>" target="_blank"><asp:Label ID="CI_WebLabel" runat="server" 
                            Text='<%# Bind("CI_Web") %>' /></a>
                        
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        <b>Comision:</b>
                        <asp:Label ID="QuoteLabel" runat="server" 
                            Text='<%# Bind("Quote") %>' />
                        <br />
                        <b>Imagen:</b>
                        <asp:Label ID="IMG_ImageLabel" runat="server" 
                            Text='<%# Bind("IMG_Image") %>' />
                        
                         <br /><br /> 
                         <div class="separador"></div> 
                         <br />
                        
                        
        <asp:ImageButton ID="EditButton" runat="server"  ImageUrl="~/images/btnEditar.png"  CssClass="botones" CausesValidation="False" 
                            CommandName="Edit" Text="Editar" />
                       
        <asp:ImageButton ID="DeleteButton" runat="server"  ImageUrl="~/images/btnEliminar.png"  CssClass="botones" CausesValidation="False" 
                            CommandName="Delete" Text="Eliminar" />
                        
        <asp:ImageButton ID="NewButton" runat="server"  ImageUrl="~/images/btnNuevo.png"  CssClass="botones" CausesValidation="False" 
                            CommandName="New" Text="Nuevo" />
                    </ItemTemplate>
                    <PagerStyle BackColor="#CCCCCC" ForeColor="Black" HorizontalAlign="Left" />
                    <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#000000" Font-Bold="True" ForeColor="White" />
                </asp:FormView>
                 
            <asp:SqlDataSource ID="dsEmpleados" runat="server" 
                ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
                
                    SelectCommand="SELECT [ID], [DNI], [Saludation], [Name], [FirstName], [LastName], [Post], [BirthDay], [CI_Telephone1], [CI_Telephone2], [CI_Telephone3], [CI_Fax], [CI_Email1], [CI_Email2], [CI_Email3], [CI_Web], [Quote], [IMG_Image], [Direccion], [Poblacion], [CP], [Provincia], [Pais] FROM [Employee] WHERE ([ID] = @ID)" 
                    ConflictDetection="CompareAllValues" 
                    DeleteCommand="DELETE FROM [Employee] WHERE [ID] = @original_ID " 
                    InsertCommand="INSERT INTO [Employee] ([DNI], [Saludation], [Name], [FirstName], [LastName], [Post], [BirthDay], [CI_Telephone1], [CI_Telephone2], [CI_Telephone3], [CI_Fax], [CI_Email1], [CI_Email2], [CI_Email3], [CI_Web], [Quote], [IMG_Image], [Direccion], [Poblacion], [CP], [Provincia], [Pais]) VALUES (@DNI, @Saludation, @Name, @FirstName, @LastName, @Post, @BirthDay, @CI_Telephone1, @CI_Telephone2, @CI_Telephone3, @CI_Fax, @CI_Email1, @CI_Email2, @CI_Email3, @CI_Web, @Quote, @IMG_Image, @Direccion, @Poblacion, @CP, @Provincia, @Pais)" 
                    OldValuesParameterFormatString="original_{0}" 
                    
                    UpdateCommand="UPDATE [Employee] SET [DNI] = @DNI, [Saludation] = @Saludation, [Name] = @Name, [FirstName] = @FirstName, [LastName] = @LastName, [Post] = @Post, [BirthDay] = @BirthDay, [CI_Telephone1] = @CI_Telephone1, [CI_Telephone2] = @CI_Telephone2, [CI_Telephone3] = @CI_Telephone3, [CI_Fax] = @CI_Fax, [CI_Email1] = @CI_Email1, [CI_Email2] = @CI_Email2, [CI_Email3] = @CI_Email3, [CI_Web] = @CI_Web, [Quote] = @Quote, [IMG_Image] = @IMG_Image, [Direccion] = @Direccion, [Poblacion] = @Poblacion, [CP] = @CP, [Provincia] = @Provincia, [Pais] = @Pais WHERE [ID] = @original_ID AND [DNI] = @original_DNI AND (([Saludation] = @original_Saludation) OR ([Saludation] IS NULL AND @original_Saludation IS NULL)) AND [Name] = @original_Name AND (([FirstName] = @original_FirstName) OR ([FirstName] IS NULL AND @original_FirstName IS NULL)) AND (([LastName] = @original_LastName) OR ([LastName] IS NULL AND @original_LastName IS NULL)) AND (([Post] = @original_Post) OR ([Post] IS NULL AND @original_Post IS NULL)) AND (([BirthDay] = @original_BirthDay) OR ([BirthDay] IS NULL AND @original_BirthDay IS NULL)) AND (([CI_Telephone1] = @original_CI_Telephone1) OR ([CI_Telephone1] IS NULL AND @original_CI_Telephone1 IS NULL)) AND (([CI_Telephone2] = @original_CI_Telephone2) OR ([CI_Telephone2] IS NULL AND @original_CI_Telephone2 IS NULL)) AND (([CI_Telephone3] = @original_CI_Telephone3) OR ([CI_Telephone3] IS NULL AND @original_CI_Telephone3 IS NULL)) AND (([CI_Fax] = @original_CI_Fax) OR ([CI_Fax] IS NULL AND @original_CI_Fax IS NULL)) AND (([CI_Email1] = @original_CI_Email1) OR ([CI_Email1] IS NULL AND @original_CI_Email1 IS NULL)) AND (([CI_Email2] = @original_CI_Email2) OR ([CI_Email2] IS NULL AND @original_CI_Email2 IS NULL)) AND (([CI_Email3] = @original_CI_Email3) OR ([CI_Email3] IS NULL AND @original_CI_Email3 IS NULL)) AND (([CI_Web] = @original_CI_Web) OR ([CI_Web] IS NULL AND @original_CI_Web IS NULL)) AND (([Quote] = @original_Quote) OR ([Quote] IS NULL AND @original_Quote IS NULL)) AND (([IMG_Image] = @original_IMG_Image) OR ([IMG_Image] IS NULL AND @original_IMG_Image IS NULL)) AND (([Direccion] = @original_Direccion) OR ([Direccion] IS NULL AND @original_Direccion IS NULL)) AND (([Poblacion] = @original_Poblacion) OR ([Poblacion] IS NULL AND @original_Poblacion IS NULL)) AND (([CP] = @original_CP) OR ([CP] IS NULL AND @original_CP IS NULL)) AND (([Provincia] = @original_Provincia) OR ([Provincia] IS NULL AND @original_Provincia IS NULL)) AND (([Pais] = @original_Pais) OR ([Pais] IS NULL AND @original_Pais IS NULL))">
                <SelectParameters>
                    <asp:QueryStringParameter Name="ID" QueryStringField="id" Type="Int32" />
                </SelectParameters>
                <DeleteParameters>
                    <asp:Parameter Name="original_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="DNI" Type="String" />
                    <asp:Parameter Name="Saludation" Type="String" />
                    <asp:Parameter Name="Name" Type="String" />
                    <asp:Parameter Name="FirstName" Type="String" />
                    <asp:Parameter Name="LastName" Type="String" />
                    <asp:Parameter Name="Post" Type="String" />
                    <asp:Parameter Name="BirthDay" Type="String"  />
                    <asp:Parameter Name="CI_Telephone1" Type="String" />
                    <asp:Parameter Name="CI_Telephone2" Type="String" />
                    <asp:Parameter Name="CI_Telephone3" Type="String" />
                    <asp:Parameter Name="CI_Fax" Type="String" />
                    <asp:Parameter Name="CI_Email1" Type="String" />
                    <asp:Parameter Name="CI_Email2" Type="String" />
                    <asp:Parameter Name="CI_Email3" Type="String" />
                    <asp:Parameter Name="CI_Web" Type="String" />
                    <asp:Parameter Name="Quote" Type="Decimal" />
                    <asp:Parameter Name="IMG_Image" Type="String" />
                    <asp:Parameter Name="Direccion" Type="String" />
                    <asp:Parameter Name="Poblacion" Type="String" />
                    <asp:Parameter Name="CP" Type="String" />
                    <asp:Parameter Name="Provincia" Type="String" />
                    <asp:Parameter Name="Pais" Type="String" />
                    <asp:Parameter Name="original_ID" Type="Int32" />
                    <asp:Parameter Name="original_DNI" Type="String" />
                    <asp:Parameter Name="original_Saludation" Type="String" />
                    <asp:Parameter Name="original_Name" Type="String" />
                    <asp:Parameter Name="original_FirstName" Type="String" />
                    <asp:Parameter Name="original_LastName" Type="String" />
                    <asp:Parameter Name="original_Post" Type="String" />
                    <asp:Parameter Name="original_BirthDay" Type="String" />
                    <asp:Parameter Name="original_CI_Telephone1" Type="String" />
                    <asp:Parameter Name="original_CI_Telephone2" Type="String" />
                    <asp:Parameter Name="original_CI_Telephone3" Type="String" />
                    <asp:Parameter Name="original_CI_Fax" Type="String" />
                    <asp:Parameter Name="original_CI_Email1" Type="String" />
                    <asp:Parameter Name="original_CI_Email2" Type="String" />
                    <asp:Parameter Name="original_CI_Email3" Type="String" />
                    <asp:Parameter Name="original_CI_Web" Type="String" />
                    <asp:Parameter Name="original_Quote" Type="Decimal" />
                    <asp:Parameter Name="original_IMG_Image" Type="String" />
                    <asp:Parameter Name="original_Direccion" Type="String" />
                    <asp:Parameter Name="original_Poblacion" Type="String" />
                    <asp:Parameter Name="original_CP" Type="String" />
                    <asp:Parameter Name="original_Provincia" Type="String" />
                    <asp:Parameter Name="original_Pais" Type="String" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="DNI" Type="String" />
                    <asp:Parameter Name="Saludation" Type="String" />
                    <asp:Parameter Name="Name" Type="String" />
                    <asp:Parameter Name="FirstName" Type="String" />
                    <asp:Parameter Name="LastName" Type="String" />
                    <asp:Parameter Name="Post" Type="String" />
                    <asp:Parameter Name="BirthDay" Type="String" />
                    <asp:Parameter Name="CI_Telephone1" Type="String" />
                    <asp:Parameter Name="CI_Telephone2" Type="String" />
                    <asp:Parameter Name="CI_Telephone3" Type="String" />
                    <asp:Parameter Name="CI_Fax" Type="String" />
                    <asp:Parameter Name="CI_Email1" Type="String" />
                    <asp:Parameter Name="CI_Email2" Type="String" />
                    <asp:Parameter Name="CI_Email3" Type="String" />
                    <asp:Parameter Name="CI_Web" Type="String" />
                    <asp:Parameter Name="Quote" Type="Decimal" />
                    <asp:Parameter Name="IMG_Image" Type="String" />
                    <asp:Parameter Name="Direccion" Type="String" />
                    <asp:Parameter Name="Poblacion" Type="String" />
                    <asp:Parameter Name="CP" Type="String" />
                    <asp:Parameter Name="Provincia" Type="String" />
                    <asp:Parameter Name="Pais" Type="String" />
                </InsertParameters>
            </asp:SqlDataSource>
            
            
                <br />
            </p>
            <p>
            </p>

 </ContentTemplate>
</ajaxcontroltoolkit:TabPanel>

<ajaxcontroltoolkit:TabPanel runat="server" ID="pnlAdress"  HeaderText="Direccion">
    <ContentTemplate>


 <asp:FormView ID="fvAdress" runat="server" CellPadding="4" DataKeyNames="ID" DataSourceID="dsAddress" 
            ForeColor="#333333"  
            Width="670px" AllowPaging="True"  >
            <FooterStyle BackColor="#b3b3b3" Font-Bold="True" ForeColor="White" />
            <RowStyle BackColor="#b3b3b3"  /><EditRowStyle  BackColor="#b3b3b3"  ForeColor="White" />
            <EditItemTemplate>

<!--
             ID:
                <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
              <br />
          OwnedByID:
                <asp:TextBox ID="OwnedByIDTextBox" runat="server" 
                    Text='<%# Bind("OwnedByID") %>' />
                <br />
                OwnedByType:
                <asp:TextBox ID="OwnedByTypeTextBox" runat="server" 
                    Text='<%# Bind("OwnedByType") %>' />
                <br />
         -->
                <div class="separador"></div> 
                <br />
                
               
               <b> Tipo de direccion:</b>
                <asp:DropDownList ID="IdAddressTypeTextBox" runat="server" DataSourceID="dsTypeAddress" DataTextField="Description" 
                    DataValueField="ID"  
                    Text='<%# Bind("IdAddressType") %>' />
                     <asp:SqlDataSource ID="dsTypeAddress" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
                    SelectCommand="SELECT [Description], [ID] FROM [AddressType]">
                </asp:SqlDataSource>
                <br />
                Direccion:
                <asp:TextBox ID="AI_StreetTextBox" runat="server" 
                    Text='<%# Bind("AI_Street") %>' />
                <br />
                Codigo Postal:
                <asp:TextBox ID="AI_PostalCodeTextBox" runat="server" 
                    Text='<%# Bind("AI_PostalCode") %>' />
                <br />
                
                Region:
                <asp:TextBox ID="AI_RegionTextBox" runat="server" 
                    Text='<%# Bind("AI_Region") %>' />
                <br />
                
                Provincia:
                <asp:TextBox ID="AI_ProvinceTextBox" runat="server" 
                    Text='<%# Bind("AI_Province") %>' />
                <br />
                Pais:
                <asp:TextBox ID="AI_CountryTextBox" runat="server" 
                    Text='<%# Bind("AI_Country") %>' />
                <br /><br />
                  <div class="separador"></div> 
                <br />
                 Notas:<br />
                <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>'  TextMode="MultiLine" Height="100px" Width="600px" />
               
                <br /><br />
                  <div class="separador"></div> 
                <br />
<!--                
                SHI_AI_Street:
                <asp:TextBox ID="SHI_AI_StreetTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Street") %>' />
                <br />
                SHI_AI_Region:
                <asp:TextBox ID="SHI_AI_RegionTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Region") %>' />
                <br />
                SHI_AI_PostalCode:
                <asp:TextBox ID="SHI_AI_PostalCodeTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_PostalCode") %>' />
                <br />
                SHI_AI_Province:
                <asp:TextBox ID="SHI_AI_ProvinceTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Province") %>' />
                <br />
                SHI_AI_Country:
                <asp:TextBox ID="SHI_AI_CountryTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Country") %>' />
                <br />
                SHI_IdShippingMethod:
                <asp:TextBox ID="SHI_IdShippingMethodTextBox" runat="server" 
                    Text='<%# Bind("SHI_IdShippingMethod") %>' />
                <br />
                SHI_IdFreightTerms:
                <asp:TextBox ID="SHI_IdFreightTermsTextBox" runat="server" 
                    Text='<%# Bind("SHI_IdFreightTerms") %>' />
                <br />
              -->  
<asp:ImageButton ID="UpdateButton" runat="server"  ImageUrl="~/images/btnGuardar.png"  CssClass="botones" CausesValidation="True" 
                    CommandName="Update" Text="Actualizar" />
               
<asp:ImageButton ID="UpdateCancelButton" runat="server"  ImageUrl="~/images/btnCancelar.png"  CssClass="botones" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
                                     
            </EditItemTemplate>
            <InsertItemTemplate>
         <!--       ID:
                <asp:TextBox ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>' />
                <br />
       
        
                OwnedByID:
                <asp:TextBox ID="OwnedByIDTextBox" runat="server" 
                    Text='<%# Bind("OwnedByID") %>' />
                <br />
                OwnedByType:
                <asp:TextBox ID="OwnedByTypeTextBox" runat="server" 
                    Text='<%# Bind("OwnedByType") %>' />
                <br />
                  <div class="separador"></div> 
                 <br />
                 
       -->         
                 <div class="separador"></div> 
                <br />
             
                
                
                <b>Tipo de direccion:</b>
                <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="dsTypeAddress" DataTextField="Description" 
                    DataValueField="ID"  
                    Text='<%# Bind("IdAddressType") %>' />
                     <asp:SqlDataSource ID="dsTypeAddress" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
                    SelectCommand="SELECT [Description], [ID] FROM [AddressType]">
                </asp:SqlDataSource>
                
                <br />
                <b>Direccion:</b>
                <asp:TextBox ID="AI_StreetTextBox" runat="server" 
                    Text='<%# Bind("AI_Street") %>' />
                <br />
                <b>Codigo Postal:</b>
                <asp:TextBox ID="AI_PostalCodeTextBox" runat="server" 
                    Text='<%# Bind("AI_PostalCode") %>' />
                <br />
                
                <b>Localidad:</b>
                <asp:TextBox ID="AI_RegionTextBox" runat="server" 
                    Text='<%# Bind("AI_Region") %>' />
                <br />
                
                <b>Provincia:</b>
                <asp:TextBox ID="AI_ProvinceTextBox" runat="server" 
                    Text='<%# Bind("AI_Province") %>' />
                <br />
                <b>Pais:</b>
                <asp:TextBox ID="AI_CountryTextBox" runat="server" 
                    Text='<%# Bind("AI_Country") %>' />
                <br />
                
  <!--               SHI_AI_Street:
                <asp:TextBox ID="SHI_AI_StreetTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Street") %>' />
                <br />
                SHI_AI_Region:
                <asp:TextBox ID="SHI_AI_RegionTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Region") %>' />
                <br />
                SHI_AI_PostalCode:
                <asp:TextBox ID="SHI_AI_PostalCodeTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_PostalCode") %>' />
                <br />
                SHI_AI_Province:
                <asp:TextBox ID="SHI_AI_ProvinceTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Province") %>' />
                <br />
                SHI_AI_Country:
                <asp:TextBox ID="SHI_AI_CountryTextBox" runat="server" 
                    Text='<%# Bind("SHI_AI_Country") %>' />
                <br />
                SHI_IdShippingMethod:
                <asp:TextBox ID="SHI_IdShippingMethodTextBox" runat="server" 
                    Text='<%# Bind("SHI_IdShippingMethod") %>' />
                <br />
                SHI_IdFreightTerms:
                <asp:TextBox ID="SHI_IdFreightTermsTextBox" runat="server" 
                    Text='<%# Bind("SHI_IdFreightTerms") %>' />
          -->     <br />
       
          <div class="separador"></div> 
                 <br />
                 <b>Notas:</b><br />
                <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>'  TextMode="MultiLine" Height="100px" Width="600px" />
                
                <br /><br />
                 <div class="separador"></div> 
                <br />
                
<asp:ImageButton ID="InsertButton" runat="server"  ImageUrl="~/images/btnGuardar.png"  CssClass="botones" CausesValidation="True" 
                    CommandName="Insert" Text="Insertar" />
               
<asp:ImageButton ID="InsertCancelButton" runat="server"  ImageUrl="~/images/btnCancelar.png"  CssClass="botones" 
                    CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
            </InsertItemTemplate>
            <ItemTemplate>
        <!--         ID:
                <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                <br />
                OwnedByID:
                <asp:Label ID="OwnedByIDLabel" runat="server" Text='<%# Bind("OwnedByID") %>' />
                <br />
                OwnedByType:
                <asp:Label ID="OwnedByTypeLabel" runat="server" 
                    Text='<%# Bind("OwnedByType") %>' />
                <br />
        -->     
                 <div class="separador"></div> 
                 <br />
                
                
                <b>Tipo:</b>
                <asp:Label ID="IdAddressTypeLabel" runat="server" 
                    Text='<%# Bind("AddressType") %>' />
                <br />
                <b>Direccion:</b>
                <asp:Label ID="AI_StreetLabel" runat="server" Text='<%# Bind("AI_Street") %>' />
                <br />
                <b>Codigo Postal:</b>
                <asp:Label ID="AI_PostalCodeLabel" runat="server" 
                    Text='<%# Bind("AI_PostalCode") %>' />
                <br />
                
                <b>Localidad:</b>
                <asp:Label ID="AI_RegionLabel" runat="server" Text='<%# Bind("AI_Region") %>' />
                <br />
                
                <b>Provincia:</b>
                <asp:Label ID="AI_ProvinceLabel" runat="server" 
                    Text='<%# Bind("AI_Province") %>' />
                <br />
                <b>Pais:</b>
                <asp:Label ID="AI_CountryLabel" runat="server" 
                    Text='<%# Bind("AI_Country") %>' />
               
               
               <br /><br /> 
                 <div class="separador"></div> 
                 <br />
                <b>Notas:</b>
                <asp:Label ID="NameLabel" runat="server" Text='<%# Bind("Name") %>' />
                
                <br /><br /> 
                 <div class="separador"></div> 
                 <br />
                
         <!--       SHI_AI_Street:
                <asp:Label ID="SHI_AI_StreetLabel" runat="server" 
                    Text='<%# Bind("SHI_AI_Street") %>' />
                <br />
                SHI_AI_Region:
                <asp:Label ID="SHI_AI_RegionLabel" runat="server" 
                    Text='<%# Bind("SHI_AI_Region") %>' />
                <br />
                SHI_AI_PostalCode:
                <asp:Label ID="SHI_AI_PostalCodeLabel" runat="server" 
                    Text='<%# Bind("SHI_AI_PostalCode") %>' />
                <br />
                SHI_AI_Province:
                <asp:Label ID="SHI_AI_ProvinceLabel" runat="server" 
                    Text='<%# Bind("SHI_AI_Province") %>' />
                <br />
                SHI_AI_Country:
                <asp:Label ID="SHI_AI_CountryLabel" runat="server" 
                    Text='<%# Bind("SHI_AI_Country") %>' />
                <br />
                SHI_IdShippingMethod:
                <asp:Label ID="SHI_IdShippingMethodLabel" runat="server" 
                    Text='<%# Bind("SHI_IdShippingMethod") %>' />
                <br />
                SHI_IdFreightTerms:
                <asp:Label ID="SHI_IdFreightTermsLabel" runat="server" 
                    Text='<%# Bind("SHI_IdFreightTerms") %>' />
                <br />
          --> 
          
                     <asp:ImageButton ID="EditButton" runat="server"  ImageUrl="~/images/btnEditar.png"  CssClass="botones" CausesValidation="False" 
                    CommandName="Edit" Text="Editar" />
                    
                    
               
<asp:ImageButton ID="DeleteButton" runat="server"  ImageUrl="~/images/btnEliminar.png"  CssClass="botones" CausesValidation="False" 
                    CommandName="Delete" Text="Eliminar" />
                
<asp:ImageButton ID="NewButton" runat="server"  ImageUrl="~/images/btnNuevo.png"  CssClass="botones" CausesValidation="False" 
                    CommandName="New" Text="Nuevo" />
          
          
               
            
            </ItemTemplate>
        </asp:FormView>
    
    
   
        <asp:SqlDataSource ID="dsAddress" runat="server" 
            ConnectionString="<%$ ConnectionStrings:gesworkConnectionString %>" 
            DeleteCommand="DELETE FROM [Address] WHERE [ID] = @ID" 
            InsertCommand="INSERT INTO [Address] ( [OwnedByID], [OwnedByType], [Name], [IdAddressType], [AI_Street], [AI_Region], [AI_PostalCode], [AI_Province], [AI_Country], [SHI_AI_Street], [SHI_AI_Region], [SHI_AI_PostalCode], [SHI_AI_Province], [SHI_AI_Country], [SHI_IdShippingMethod], [SHI_IdFreightTerms]) VALUES ( @OwnedByID, '3', @Name, @IdAddressType, @AI_Street, @AI_Region, @AI_PostalCode, @AI_Province, @AI_Country, @SHI_AI_Street, @SHI_AI_Region, @SHI_AI_PostalCode, @SHI_AI_Province, @SHI_AI_Country, @SHI_IdShippingMethod, @SHI_IdFreightTerms)" 
            SelectCommand="SELECT Address.ID, [OwnedByID], [OwnedByType], [Name], [IdAddressType],AddressType.description As AddressType, [AI_Street], [AI_Region], 
                            [AI_PostalCode], [AI_Province], [AI_Country], [SHI_AI_Street], [SHI_AI_Region], [SHI_AI_PostalCode], 
                            [SHI_AI_Province], [SHI_AI_Country], [SHI_IdShippingMethod], [SHI_IdFreightTerms] 

                            FROM [Address], AddressType

                            WHERE ((Address.idAddressType = AddressType.id) AND(Address.OwnedByType = 3) AND (Address.OwnedByID =  @OwnedByID))" 
            UpdateCommand="UPDATE [Address] SET [Name] = @Name, [IdAddressType] = @IdAddressType, [AI_Street] = @AI_Street, [AI_Region] = @AI_Region, [AI_PostalCode] = @AI_PostalCode, [AI_Province] = @AI_Province, [AI_Country] = @AI_Country, [SHI_AI_Street] = @SHI_AI_Street, [SHI_AI_Region] = @SHI_AI_Region, [SHI_AI_PostalCode] = @SHI_AI_PostalCode, [SHI_AI_Province] = @SHI_AI_Province, [SHI_AI_Country] = @SHI_AI_Country, [SHI_IdShippingMethod] = @SHI_IdShippingMethod, [SHI_IdFreightTerms] = @SHI_IdFreightTerms WHERE [ID] = @ID">
            <SelectParameters>
                <asp:Parameter DefaultValue="1" Name="OwnedByType" Type="Int32" />
                <asp:QueryStringParameter Name="OwnedByID" QueryStringField="id" 
                    Type="String" />
            </SelectParameters>
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="OwnedByID" Type="String" />
                <asp:Parameter Name="OwnedByType" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="IdAddressType" Type="Int32" />
                <asp:Parameter Name="AI_Street" Type="String" />
                <asp:Parameter Name="AI_Region" Type="String" />
                <asp:Parameter Name="AI_PostalCode" Type="String" />
                <asp:Parameter Name="AI_Province" Type="String" />
                <asp:Parameter Name="AI_Country" Type="String" />
                <asp:Parameter Name="SHI_AI_Street" Type="String" />
                <asp:Parameter Name="SHI_AI_Region" Type="String" />
                <asp:Parameter Name="SHI_AI_PostalCode" Type="String" />
                <asp:Parameter Name="SHI_AI_Province" Type="String" />
                <asp:Parameter Name="SHI_AI_Country" Type="String" />
                <asp:Parameter Name="SHI_IdShippingMethod" Type="String" />
                <asp:Parameter Name="SHI_IdFreightTerms" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:QueryStringParameter Name="OwnedByID"  QueryStringField="id"  Type="String" />
                <asp:Parameter Name="OwnedByType" Type="Int32" />
                <asp:Parameter Name="Name" Type="String" />
                <asp:Parameter Name="IdAddressType" Type="Int32" />
                <asp:Parameter Name="AI_Street" Type="String" />
                <asp:Parameter Name="AI_Region" Type="String" />
                <asp:Parameter Name="AI_PostalCode" Type="String" />
                <asp:Parameter Name="AI_Province" Type="String" />
                <asp:Parameter Name="AI_Country" Type="String" />
                <asp:Parameter Name="SHI_AI_Street" Type="String" />
                <asp:Parameter Name="SHI_AI_Region" Type="String" />
                <asp:Parameter Name="SHI_AI_PostalCode" Type="String" />
                <asp:Parameter Name="SHI_AI_Province" Type="String" />
                <asp:Parameter Name="SHI_AI_Country" Type="String" />
                <asp:Parameter Name="SHI_IdShippingMethod" Type="String" />
                <asp:Parameter Name="SHI_IdFreightTerms" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    
     <asp:ImageButton ID="btnNewAddres" runat="server"  ImageUrl="~/images/btnNuevo.png"  CssClass="botones"  OnClick="nuevaDireccion" 
                    Text="Nuevo" Visible="false" />
    
      
    </ContentTemplate>
</ajaxcontroltoolkit:TabPanel>
</ajaxcontroltoolkit:TabContainer>
</asp:content>

